//
//  JSBridgeManager.h
//  JSBridgeDemo
//
//  Created by zhang_rongwu on 16/3/1.
//  Copyright © 2016年 zhang_rongwu. All rights reserved.
//  

#import <Foundation/Foundation.h>
#import <WebKit/WebKit.h>
@class JSBridgeManager;
@protocol JSBridgeManagerDelegate <NSObject>

- (void)jsBridge:(JSBridgeManager *)bridge
didReceivedNotiDict:(NSDictionary*)dict
    Notification:(NSString*)notificationString
     fromWebView:(WKWebView *)webview;
// 页面打开失败
- (void)jsBridge:(JSBridgeManager *)bridge didFailProvisionalNavigation:(WKNavigation *)navigation withError:(NSError *)error;

@end

@interface JSBridgeManager : NSObject<WKNavigationDelegate, WKScriptMessageHandler>

@property (nonatomic, assign) id <JSBridgeManagerDelegate> delegate;
@property (nonatomic, strong) NSMutableDictionary *infoList;

+ (id)jsBridgeWithDelegate:(id <JSBridgeManagerDelegate>)delegate;

- (void)postNotificationJavaScript:(NSString *)javaScript
                     toWebView:(WKWebView *)webView;
@end
